//
//  LYSideslipCell.h
//  LYSideslipCellDemo
//
//  Created by Louis on 16/7/5.
//  Copyright © 2016年 Louis. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface LYSideslipCellAction : NSObject
+ (instancetype)rowActionWithBackgroundColor:(UIColor *)backgroundColor title:(nullable NSString *)title titleColor:(nullable UIColor *)titleColor titleFontSize:(CGFloat)fontSize image:(nullable UIImage *)image speed:(CGFloat)speed handler:(void (^)(LYSideslipCellAction *action, NSIndexPath *indexPath))handler;
@property (nonatomic, copy, nullable) NSString *title;          // 文字内容
@property (nonatomic, strong, nullable) UIImage *image;         // 按钮图片. 默认无图
@property (nonatomic, assign) CGFloat fontSize;                 // 字体大小. 默认17
@property (nonatomic, strong, nullable) UIColor *titleColor;    // 文字颜色. 默认白色
@property (nonatomic, copy, nullable) UIColor *backgroundColor; // 背景颜色. 默认透明
@property (nonatomic, assign) CGFloat margin;                   // 内容左右间距. 默认15

@property (nonatomic, assign) CGFloat speed;                    //侧滑拉扯移动比例

@end

@class LYSideslipCell;
@protocol LYSideslipCellDelegate <NSObject>
@optional;


//隐藏除自身cell外，其他cell的侧滑视图

- (void)hiddenSideslipWithOutSelf:(NSIndexPath *)index;

//隐藏全部cell的侧滑视图

- (void)hiddenSideslipAll;

@end


@interface LYSideslipCell : UITableViewCell

@property (nonatomic, weak) id<LYSideslipCellDelegate> delegate;

@property (nonatomic, copy)NSArray <LYSideslipCellAction *>* actions;

@property (nonatomic, strong) NSIndexPath *cellIndex;               // cell索引

/**
 *  按钮容器
 */
@property (nonatomic, strong) UIView *btnContainView;

/**
 *  隐藏侧滑按钮
 */
- (void)hiddenSideslip;
@end


NS_ASSUME_NONNULL_END
